#include <wx/scrolwin.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/spinctrl.h>
#include <wx/textctrl.h>
#include <wx/msgdlg.h>
#include <wx/checkbox.h>
#include "cameraDriver.h"

class CameraControl : public wxScrolled<wxWindow>
{
public:
	CameraControl(wxWindow* parent);
	void SetCameraDevice(std::list<cameraDriver::cameraDevice>::iterator _device);
	void UpdateFrameRate();
	void UpdateSpeedLink();
	void disableSubFunOnCameraRunning();
	void enableSubFunOnCameraNotRunning();
	void SetExposeTime(const int32_t value);
	int GetFrameRate();
	void SetTriggerMode(bool mode);
	void SetImageHeight(const int32_t value);
    void SetImageWidth(const int32_t value);
    void SetImageOffsetX(const int32_t value);
    void SetImageOffsetY(const int32_t value);
    void SetFrameRate(const int32_t value);
private:
	std::list<cameraDriver::cameraDevice>::iterator CameraDevice;
	void UpdateCameraInf();
	//wxStaticText* labSensorHeight;
	//wxStaticText* labSensorWidth;
	wxStaticText* labCatchFrameRate;
	wxStaticText* labSpeedLink;
	wxSpinCtrl* spinImageHeight;
	wxCheckBox* cboxTrigger;
	wxSpinCtrl* spinImageWidth;
	wxSpinCtrl* spinOffsetX;
	wxSpinCtrl* spinOffsetY;
	wxSpinCtrlDouble* spinExposureTime;
	wxSpinCtrl* spinCmpAcceleration;
	wxSpinCtrl* spinFrameRateControl;
	
	void on_cboxTrigger_click(wxCommandEvent& event);
	void on_spinImageHeight_change(wxSpinEvent& event);
	void on_spinImageWidth_change(wxSpinEvent& event);
	void on_spinImageOffsetX_change(wxSpinEvent& event);
	void on_spinImageOffsetY_change(wxSpinEvent& event);
	void on_spinExposureTime_textEnter(wxSpinDoubleEvent& event);
	void on_spinCmpAcceleration_change(wxSpinEvent& event);
	void on_spinFrameRateControl_change(wxSpinEvent& event);
};

enum class CameraControlID : int
{
	spinImageHeight = 200,
	spinImageWidth,
	spinExposureTime,
	spinOffsetX,
	spinOffsetY,
	spinCmpAcceleration,
	cboxTrigger,
	spinFrameRateControl
};